﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Space_Conquest
{
    class Portrait: IRender, IInput
    {


        #region Member Variables

        private Sprite _sprPortrait = new Sprite(0, 0, 72, 72, 255, false);
        private Texture _texLaborer= new Texture("Images/LaborerPortrait.jpg");
        private Texture _texMetal = new Texture("Images/metal.jpg");
        private Texture _texAirStation = new Texture("Images/airstation.jpg");
        private Texture _texBarrack = new Texture("Images/barracks.jpg");
        private Texture _texBattleship = new Texture("Images/battleship.jpg");
        private Texture _texFactory = new Texture("Images/factory.jpg");
        private Texture _texJeep = new Texture("Images/JeepPortrait.jpg");
        private Texture _texLightShip = new Texture("Images/lightShip.jpg");
        private Texture _texOilField= new Texture("Images/oil.jpg");
        private Texture _texPowerPlant = new Texture("Images/powerplant.jpg");
        private Texture _texRobot = new Texture("Images/RobotPortrait.gif");
        private Texture _texSoldier = new Texture("Images/SoldierPortrait.gif");
        private Texture _texTank = new Texture("Images/tank.jpg");
        private Texture _texTownCenter = new Texture("Images/TownCenter.jpg");
        private Texture _texTransporter = new Texture("Images/temp.jpg");
        private Texture _texTurret = new Texture("Images/turret.jpg");
        private Player _player;

        #endregion

        #region Constructors

        public Portrait(Player player)
        {
            _player = player;
        } 

        #endregion

        #region IRender Members

        public void Render()
        {
            _sprPortrait.Left = 100;
            _sprPortrait.Bottom = Globals.iScreenHeight - 38;

            if (_player.SelectedUnit != null)
            {
                if (_player.SelectedUnit is Laborer)
                {
                    _sprPortrait.Render(_texLaborer);
                }
                if (_player.SelectedUnit is AirStation)
                {
                    _sprPortrait.Render(_texAirStation);
                }
                if (_player.SelectedUnit is Barrack)
                {
                    _sprPortrait.Render(_texBarrack);
                }
                if (_player.SelectedUnit is Battleship)
                {
                    _sprPortrait.Render(_texBattleship);
                }
                if (_player.SelectedUnit is Factory)
                {
                    _sprPortrait.Render(_texFactory);
                }
                if (_player.SelectedUnit is Jeep)
                {
                    _sprPortrait.Render(_texJeep);
                }
                if (_player.SelectedUnit is LightShip)
                {
                    _sprPortrait.Render(_texLightShip);
                }
                if (_player.SelectedUnit is Metal)
                {
                    _sprPortrait.Render(_texMetal);
                }
                if (_player.SelectedUnit is OilField)
                {
                    _sprPortrait.Render(_texOilField);
                }
                if (_player.SelectedUnit is PowerPlant)
                {
                    _sprPortrait.Render(_texPowerPlant);
                }
                if (_player.SelectedUnit is Robot)
                {
                    _sprPortrait.Render(_texRobot);
                }
                if (_player.SelectedUnit is Soldier)
                {
                    _sprPortrait.Render(_texSoldier);
                }
                if (_player.SelectedUnit is Tank)
                {
                    _sprPortrait.Render(_texTank);
                }
                if (_player.SelectedUnit is TownCenter)
                {
                    _sprPortrait.Render(_texTownCenter);
                }
                if (_player.SelectedUnit is Transporter)
                {
                    _sprPortrait.Render(_texTransporter);
                }
                if (_player.SelectedUnit is Turret)
                {
                    _sprPortrait.Render(_texTurret);
                }
            }
        }


        #endregion

        #region IInput Members

        public bool MouseDown(System.Windows.Forms.MouseButtons button, int x, int y)
        {
            return false;
        }

        public bool MouseUp(System.Windows.Forms.MouseButtons button, int x, int y)
        {
            return false;
        }

        public bool MouseMove(int x, int y)
        {
            return false;
        }

        public bool KeyDown(System.Windows.Forms.Keys key, bool shift)
        {
            return false;
        }

        public bool KeyUp(System.Windows.Forms.Keys key, bool shift)
        {
            return false;
        }

        #endregion
    }
}
